<?php
/*
 In order to use the open311 library, you must include class.sunlightlabs.php 
 available in the Sunlight Labs PHP Library. To download this class, visit http://emmense.com
*/
require_once('class.sunlightlabs.php');

/*
 The DC Open 311 PHP class includes a class for the Open 311 API and the Geocoding API.
 Note that these APIs is in support of the DC City Government and maintained by the 
 Office of the Chief Technology Officer (OCTO) of the District of Columbia. We cannot
 guarantee that the API will not change in the future, but wil do our best to keep up with
 their modifications. Also, though we hope other cities follow OCTO's lead, the API is intended for
 the District of Columbia only.
*/
require_once('class.open311.php');

// Create a new instance
$open311 = new OpenDc311;

// Supply the API Key provided by OCTO. Sign up here: http://api.dc.gov/key
$open311->api_key = '12345678910';

// This is the endpoint for the library. Each API is different but follows this standard: http://api.dc.gov/api_name/ where api_name is open311 or geocoding
$open311->request_url = 'http://api.dc.gov/open311/';

// Optional: The version number of the API. Currently, only v1 is available. If omitted, this is the default.
$open311->api_version = 'v1';

// Optional: Declare XML or JSON. JSON is preferred but requires PHP 5.2+; XML is not yet supported. Defaults to JSON if omitted.
$open311->type = 'json';

// Optional: Give your app a user agent that will identify itself to OCTO. This is good practice. Include an email address so they can contact you if they need to.
$open311->user_agent = 'My very cool app that will help me avoid parking tickets - Aaron Brazell (aaron@technosailor.com)';

// Optional: if you need to send additional HTTP headers, include them in an array. If in doubt, don't include this.
$open311->headers = array();

// Optional: To show debug information, set this to true. By default, debug is set to false (off)
$open311->debug = false;

// Return (and print) a list of possible service types from the DC 311 service.
echo '<pre>';
var_dump( $open311->getServices() );
echo '</pre>';
?>
